<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml" layout:decorate="~{layout/template}">
<head>
    <title>新增</title>
    <link rel="stylesheet" href="/css/system/resource/add.css"/>
</head>
<body>
<div id="contentContainer" layout:fragment="content" class="contentContainer navItem" v-cloak>

<el-row>
    <el-col :span="12" :offset="6">
    <el-form :model="form" :rules="rules" ref="form" label-width="80px">
        <el-form-item label="资源名" prop="name">
            <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="类型" prop="type">
            <el-radio-group v-model="form.type" @change="onTypeChange">
                <el-radio label="0">模块</el-radio>
                <el-radio label="1">菜单</el-radio>
                <el-radio label="2">功能</el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item label="父资源" prop="parentIdList" v-if="form.type!=0">
            <el-cascader
                    :show-all-levels="true"
                    v-model="form.parentIdList"
                    :options="options"
                    :props="props">
            </el-cascader>
        </el-form-item>
        <el-form-item label="URL" prop="url" v-if="form.type!=0">
            <el-input v-model="form.url"></el-input>
        </el-form-item>
        <el-form-item label="资源标识" prop="permission">
            <el-input v-model="form.permission"></el-input>
        </el-form-item>
        <el-form-item label="排序" prop="priority">
            <el-input-number v-model="form.priority" :controls="true" :min="0"></el-input-number>
        </el-form-item>
        <el-form-item label="图标">
            <el-input v-model="form.iconClass"></el-input>
            <a href="https://fontawesome.com/v4.7.0/icons/" target="_blank">图标列表</a>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="submitForm('form')">立即创建</el-button>
            <el-button @click="resetForm('form')">重置</el-button>
        </el-form-item>
    </el-form>
    </el-col>
</el-row>

</div>

<th:block layout:fragment="staticFile">
<script src="/js/system/resource/add.js"></script>
</th:block>

</body>
</html>